package o;

import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class bns {
    private static bns ॱ = new bns();
    private Properties ˊ = new Properties();
    private boolean ˎ = false;

    private bns() {
    }

    public static bns ॱ() {
        return ॱ;
    }

    public void ˊ() {
        Throwable th;
        this.ˎ = false;
        FileInputStream fileInputStream = null;
        FileInputStream fileInputStream2;
        try {
            fileInputStream2 = new FileInputStream(new File(Environment.getExternalStorageDirectory(), "mock.properties"));
            try {
                this.ˊ.load(fileInputStream2);
                this.ˎ = true;
                Log.i("MockConfigure", "MockConfigure loadConfig succeed");
                if (fileInputStream2 != null) {
                    try {
                        fileInputStream2.close();
                    } catch (Exception e) {
                        Log.i("MockConfigure", "close exception");
                    }
                }
            } catch (FileNotFoundException e2) {
                try {
                    Log.i("MockConfigure", "MockConfigure: no test stub");
                    if (fileInputStream2 != null) {
                        try {
                            fileInputStream2.close();
                        } catch (Exception e3) {
                            Log.i("MockConfigure", "close exception");
                        }
                    }
                } catch (Throwable th2) {
                    Throwable th3 = th2;
                    fileInputStream = fileInputStream2;
                    th = th3;
                    if (fileInputStream != null) {
                        try {
                            fileInputStream.close();
                        } catch (Exception e4) {
                            Log.i("MockConfigure", "close exception");
                        }
                    }
                    throw th;
                }
            } catch (IOException e5) {
                Log.i("MockConfigure", "MockConfigure load properties file failed");
                if (fileInputStream2 != null) {
                    try {
                        fileInputStream2.close();
                    } catch (Exception e6) {
                        Log.i("MockConfigure", "close exception");
                    }
                }
            }
        } catch (FileNotFoundException e7) {
            fileInputStream2 = null;
            Log.i("MockConfigure", "MockConfigure: no test stub");
            if (fileInputStream2 != null) {
                fileInputStream2.close();
            }
        } catch (IOException e8) {
            fileInputStream2 = null;
            Log.i("MockConfigure", "MockConfigure load properties file failed");
            if (fileInputStream2 != null) {
                fileInputStream2.close();
            }
        } catch (Throwable th4) {
            th = th4;
            if (fileInputStream != null) {
                fileInputStream.close();
            }
            throw th;
        }
    }

    public boolean ˎ() {
        return this.ˎ;
    }

    public int ˋ() {
        try {
            return Integer.parseInt(this.ˊ.getProperty("mock"));
        } catch (NumberFormatException e) {
            return -1;
        }
    }

    public int ˏ() {
        try {
            return Integer.parseInt(this.ˊ.getProperty("round"));
        } catch (NumberFormatException e) {
            return -1;
        }
    }
}
